@use '../partials/mixin' as mx;

.CSS_START_components_combobox {
  display: none;
}

.react_aria_ComboBox {
  color: var(--color-text-primary);
  padding-bottom: 15px;
  margin: 10px 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;

  .my_combobox_container {
    border: 1px solid var(--color-gray-950);
    border-radius: 6px;
    display: flex;
    align-items: center;
    width: 360px;
    padding-right: 10px;
    position: relative;

    > svg {
      width: 20px;
      height: 20px;
      position: absolute;
      left: 5px;
      fill: var(--color-text-primary);
    }

    &:has(.react_aria_Input[data-focused]) {
      outline: var(--color-brand-primary) solid 2px !important;
      outline-offset: -2px;
    }
  }

  .react_aria_Label {
    font-weight: 600;
    margin: 0;
  }

  .react_aria_Input {
    margin: 2px;
    font-size: 14px;
    background: transparent!important;
    color: var(--color-text-primary);
    height: 24px;
    padding: 0 5px 0 30px;
    vertical-align: middle;
    border: none;
    width: 320px;
  }

  .react_aria_Button {
    
    // display: inline-block;
    background: var(--color-neutral-base);
    color: var(--color-text-primary);
    forced-color-adjust: none;
    border-radius: 4px;
    border: none;
    margin-left: -1.714rem;
    width: 1.429rem;
    height: 1.429rem;
    padding: 0;
    font-size: 0.857rem;
    cursor: pointer;
    position: relative;

    &[data-pressed] {
      box-shadow: none;
      background: var(--color-neutral-base);
    }

    svg {
      width: 20px;
    }
  }
}

.react_aria_Popover[data-trigger="ComboBox"], .react_aria_Popover[data-trigger="Select"]  {
  width: var(--trigger-width);
  background-color: var(--color-neutral-base);
  pointer-events: auto;
  border: 1px solid var(--color-gray-950);
  border-radius: 6px;
  height: fit-content;
  max-height: 350px!important;
  overflow: hidden auto;

  @include mx.scrollbar_styling;
  
  &::-webkit-scrollbar {
    width: 10px;

    &-thumb {
        border-radius: 5px;
    }
  }

  .react_aria_ListBox {
    display: block;
    max-height: inherit;
    min-height: unset;
    border: none;

    .react_aria_Header {
      padding-left: 1.571rem;
    }
  }
}

.my_item {
    padding: 4px 8px 4px 30px;
    outline: none;
    cursor: pointer;
    color: var(--color-text-primary);
    position: relative;
    text-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;

    &[data-disabled] {
      color: var(--color-gray-300);
    }
  
    &.selected {
      font-weight: 600;
      background: none;
  
      &::before {
        content: '';
        content: '' / '';
        alt: ' ';
        position: absolute;
        top: 2px;
        left: 2px;
        background-color: var(--color-text-primary);
        mask-image: url("");
        mask-repeat: no-repeat;
        mask-position: 50% 50%;
        height: 25px;
        width: 25px;
      }
    }
  
    &.focused {
      background: var(--color-brand-secondary);
      color: var(--color-brand-primary);
    }
  }
  
  @media (forced-colors: active) {
    .my_item.focused {
      background: Highlight;
      color: HighlightText;
    }
  }

.CSS_END_components_combobox {
  display: none;
}
